package com.xyb.controller;

import com.xyb.entity.FileInfo;
import com.xyb.service.FileInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("fileInfo")
public class FileInfoController {
    @Resource
    private FileInfoService fileInfoService;

    @GetMapping("file/{fileId}")
    public FileInfo.InnerFile selectFileInfoByFileId(@PathVariable("fileId") Long fileId){
        return fileInfoService.selectFileInfoByFileId(fileId);
    }

    @GetMapping("files/{bizId}")
    public FileInfo.InnerBizFile selectFileInfoByBizId(@PathVariable("bizId") Long bizId){
        return fileInfoService.selectFileInfoByBizId(bizId);
    }
}
